3.1.1 \(\int \frac {a+b x+\frac {b f x^2}{e}}{\sqrt {d+e x+f x^2}} \, dx\) [1]

Optimal. Leaf size=102 \[ \frac {b \sqrt {d+e x+f x^2}}{4 f}+\frac {b x \sqrt {d+e x+f x^2}}{2 e}+\frac {\left (8 a f-b \left (e+\frac {4 d f}{e}\right )\right ) \tanh ^{-1}\left (\frac {e+2 f x}{2 \sqrt {f} \sqrt {d+e x+f x^2}}\right )}{8 f^{3/2}} \]

[Out]

1/8*(8*a*f-b*(e+4*d*f/e))*arctanh(1/2*(2*f*x+e)/f^(1/2)/(f*x^2+e*x+d)^(1/2))/f^(3/2)+1/4*b*(f*x^2+e*x+d)^(1/2)
/f+1/2*b*x*(f*x^2+e*x+d)^(1/2)/e

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 102, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {1675, 654, 635, 212} \begin {gather*} \frac {\left (8 a f-b \left (\frac {4 d f}{e}+e\right )\right ) \tanh ^{-1}\left (\frac {e+2 f x}{2 \sqrt {f} \sqrt {d+e x+f x^2}}\right )}{8 f^{3/2}}+\frac {b x \sqrt {d+e x+f x^2}}{2 e}+\frac {b \sqrt {d+e x+f x^2}}{4 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*x + (b*f*x^2)/e)/Sqrt[d + e*x + f*x^2],x]

[Out]

(b*Sqrt[d + e*x + f*x^2])/(4*f) + (b*x*Sqrt[d + e*x + f*x^2])/(2*e) + ((8*a*f - b*(e + (4*d*f)/e))*ArcTanh[(e
+ 2*f*x)/(2*Sqrt[f]*Sqrt[d + e*x + f*x^2])])/(8*f^(3/2))

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 635

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(4*c - x^2), x], x, (b + 2*c*x)
/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 654

Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[e*((a + b*x + c*x^2)^(p +
 1)/(2*c*(p + 1))), x] + Dist[(2*c*d - b*e)/(2*c), Int[(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, p}
, x] && NeQ[2*c*d - b*e, 0] && NeQ[p, -1]

Rule 1675

Int[(Pq_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Expon[Pq, x], e = Coeff[Pq, x, Expo
n[Pq, x]]}, Simp[e*x^(q - 1)*((a + b*x + c*x^2)^(p + 1)/(c*(q + 2*p + 1))), x] + Dist[1/(c*(q + 2*p + 1)), Int
[(a + b*x + c*x^2)^p*ExpandToSum[c*(q + 2*p + 1)*Pq - a*e*(q - 1)*x^(q - 2) - b*e*(q + p)*x^(q - 1) - c*e*(q +
 2*p + 1)*x^q, x], x], x]] /; FreeQ[{a, b, c, p}, x] && PolyQ[Pq, x] && NeQ[b^2 - 4*a*c, 0] &&  !LeQ[p, -1]

Rubi steps

\begin {align*} \int \frac {a+b x+\frac {b f x^2}{e}}{\sqrt {d+e x+f x^2}} \, dx &=\frac {b x \sqrt {d+e x+f x^2}}{2 e}+\frac {\int \frac {\left (2 a-\frac {b d}{e}\right ) f+\frac {b f x}{2}}{\sqrt {d+e x+f x^2}} \, dx}{2 f}\\ &=\frac {b \sqrt {d+e x+f x^2}}{4 f}+\frac {b x \sqrt {d+e x+f x^2}}{2 e}+\frac {\left (-b e+8 a f-\frac {4 b d f}{e}\right ) \int \frac {1}{\sqrt {d+e x+f x^2}} \, dx}{8 f}\\ &=\frac {b \sqrt {d+e x+f x^2}}{4 f}+\frac {b x \sqrt {d+e x+f x^2}}{2 e}+\frac {\left (-b e+8 a f-\frac {4 b d f}{e}\right ) \text {Subst}\left (\int \frac {1}{4 f-x^2} \, dx,x,\frac {e+2 f x}{\sqrt {d+e x+f x^2}}\right )}{4 f}\\ &=\frac {b \sqrt {d+e x+f x^2}}{4 f}+\frac {b x \sqrt {d+e x+f x^2}}{2 e}-\frac {\left (b e-8 a f+\frac {4 b d f}{e}\right ) \tanh ^{-1}\left (\frac {e+2 f x}{2 \sqrt {f} \sqrt {d+e x+f x^2}}\right )}{8 f^{3/2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.46, size = 87, normalized size = 0.85 \begin {gather*} \frac {2 b \sqrt {f} (e+2 f x) \sqrt {d+x (e+f x)}+\left (-8 a e f+b \left (e^2+4 d f\right )\right ) \log \left (e f \left (e+2 f x-2 \sqrt {f} \sqrt {d+x (e+f x)}\right )\right )}{8 e f^{3/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x + (b*f*x^2)/e)/Sqrt[d + e*x + f*x^2],x]

[Out]

(2*b*Sqrt[f]*(e + 2*f*x)*Sqrt[d + x*(e + f*x)] + (-8*a*e*f + b*(e^2 + 4*d*f))*Log[e*f*(e + 2*f*x - 2*Sqrt[f]*S
qrt[d + x*(e + f*x)])])/(8*e*f^(3/2))

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(194\) vs. \(2(84)=168\).
time = 0.14, size = 195, normalized size = 1.91

method result size
risch \(\frac {b \left (2 f x +e \right ) \sqrt {f \,x^{2}+e x +d}}{4 f e}+\frac {\frac {a e \ln \left (\frac {\frac {e}{2}+f x}{\sqrt {f}}+\sqrt {f \,x^{2}+e x +d}\right )}{\sqrt {f}}-\frac {\ln \left (\frac {\frac {e}{2}+f x}{\sqrt {f}}+\sqrt {f \,x^{2}+e x +d}\right ) b d}{2 \sqrt {f}}-\frac {\ln \left (\frac {\frac {e}{2}+f x}{\sqrt {f}}+\sqrt {f \,x^{2}+e x +d}\right ) e^{2} b}{8 f^{\frac {3}{2}}}}{e}\) \(131\)
default \(\frac {b f \left (\frac {x \sqrt {f \,x^{2}+e x +d}}{2 f}-\frac {3 e \left (\frac {\sqrt {f \,x^{2}+e x +d}}{f}-\frac {e \ln \left (\frac {\frac {e}{2}+f x}{\sqrt {f}}+\sqrt {f \,x^{2}+e x +d}\right )}{2 f^{\frac {3}{2}}}\right )}{4 f}-\frac {d \ln \left (\frac {\frac {e}{2}+f x}{\sqrt {f}}+\sqrt {f \,x^{2}+e x +d}\right )}{2 f^{\frac {3}{2}}}\right )+e b \left (\frac {\sqrt {f \,x^{2}+e x +d}}{f}-\frac {e \ln \left (\frac {\frac {e}{2}+f x}{\sqrt {f}}+\sqrt {f \,x^{2}+e x +d}\right )}{2 f^{\frac {3}{2}}}\right )+\frac {a e \ln \left (\frac {\frac {e}{2}+f x}{\sqrt {f}}+\sqrt {f \,x^{2}+e x +d}\right )}{\sqrt {f}}}{e}\) \(195\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*x+b*f*x^2/e)/(f*x^2+e*x+d)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/e*(b*f*(1/2*x/f*(f*x^2+e*x+d)^(1/2)-3/4*e/f*(1/f*(f*x^2+e*x+d)^(1/2)-1/2*e/f^(3/2)*ln((1/2*e+f*x)/f^(1/2)+(f
*x^2+e*x+d)^(1/2)))-1/2*d/f^(3/2)*ln((1/2*e+f*x)/f^(1/2)+(f*x^2+e*x+d)^(1/2)))+e*b*(1/f*(f*x^2+e*x+d)^(1/2)-1/
2*e/f^(3/2)*ln((1/2*e+f*x)/f^(1/2)+(f*x^2+e*x+d)^(1/2)))+a*e*ln((1/2*e+f*x)/f^(1/2)+(f*x^2+e*x+d)^(1/2))/f^(1/
2))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x+b*f*x^2/e)/(f*x^2+e*x+d)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*d*f-%e^2>0)', see `assume?`
for more det

________________________________________________________________________________________

Fricas [A]
time = 1.29, size = 208, normalized size = 2.04 \begin {gather*} \left [\frac {{\left ({\left (4 \, b d f - 8 \, a f e + b e^{2}\right )} \sqrt {f} \log \left (8 \, f^{2} x^{2} + 8 \, f x e - 4 \, \sqrt {f x^{2} + x e + d} {\left (2 \, f x + e\right )} \sqrt {f} + 4 \, d f + e^{2}\right ) + 4 \, {\left (2 \, b f^{2} x + b f e\right )} \sqrt {f x^{2} + x e + d}\right )} e^{\left (-1\right )}}{16 \, f^{2}}, \frac {{\left ({\left (4 \, b d f - 8 \, a f e + b e^{2}\right )} \sqrt {-f} \arctan \left (\frac {\sqrt {f x^{2} + x e + d} {\left (2 \, f x + e\right )} \sqrt {-f}}{2 \, {\left (f^{2} x^{2} + f x e + d f\right )}}\right ) + 2 \, {\left (2 \, b f^{2} x + b f e\right )} \sqrt {f x^{2} + x e + d}\right )} e^{\left (-1\right )}}{8 \, f^{2}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x+b*f*x^2/e)/(f*x^2+e*x+d)^(1/2),x, algorithm="fricas")

[Out]

[1/16*((4*b*d*f - 8*a*f*e + b*e^2)*sqrt(f)*log(8*f^2*x^2 + 8*f*x*e - 4*sqrt(f*x^2 + x*e + d)*(2*f*x + e)*sqrt(
f) + 4*d*f + e^2) + 4*(2*b*f^2*x + b*f*e)*sqrt(f*x^2 + x*e + d))*e^(-1)/f^2, 1/8*((4*b*d*f - 8*a*f*e + b*e^2)*
sqrt(-f)*arctan(1/2*sqrt(f*x^2 + x*e + d)*(2*f*x + e)*sqrt(-f)/(f^2*x^2 + f*x*e + d*f)) + 2*(2*b*f^2*x + b*f*e
)*sqrt(f*x^2 + x*e + d))*e^(-1)/f^2]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {a e}{\sqrt {d + e x + f x^{2}}}\, dx + \int \frac {b e x}{\sqrt {d + e x + f x^{2}}}\, dx + \int \frac {b f x^{2}}{\sqrt {d + e x + f x^{2}}}\, dx}{e} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x+b*f*x**2/e)/(f*x**2+e*x+d)**(1/2),x)

[Out]

(Integral(a*e/sqrt(d + e*x + f*x**2), x) + Integral(b*e*x/sqrt(d + e*x + f*x**2), x) + Integral(b*f*x**2/sqrt(
d + e*x + f*x**2), x))/e

________________________________________________________________________________________

Giac [A]
time = 4.74, size = 84, normalized size = 0.82 \begin {gather*} \frac {1}{4} \, \sqrt {f x^{2} + x e + d} {\left (2 \, b x e^{\left (-1\right )} + \frac {b}{f}\right )} + \frac {{\left (4 \, b d f - 8 \, a f e + b e^{2}\right )} e^{\left (-1\right )} \log \left ({\left | -2 \, {\left (\sqrt {f} x - \sqrt {f x^{2} + x e + d}\right )} \sqrt {f} - e \right |}\right )}{8 \, f^{\frac {3}{2}}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x+b*f*x^2/e)/(f*x^2+e*x+d)^(1/2),x, algorithm="giac")

[Out]

1/4*sqrt(f*x^2 + x*e + d)*(2*b*x*e^(-1) + b/f) + 1/8*(4*b*d*f - 8*a*f*e + b*e^2)*e^(-1)*log(abs(-2*(sqrt(f)*x
- sqrt(f*x^2 + x*e + d))*sqrt(f) - e))/f^(3/2)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {a+b\,x+\frac {b\,f\,x^2}{e}}{\sqrt {f\,x^2+e\,x+d}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*x + (b*f*x^2)/e)/(d + e*x + f*x^2)^(1/2),x)

[Out]

int((a + b*x + (b*f*x^2)/e)/(d + e*x + f*x^2)^(1/2), x)

________________________________________________________________________________________